<template>
  <div>
    
  </div>
  <a-layout>
    <a-layout-sider theme="light" v-model:collapsed="collapsed" :trigger="null" collapsible>
      <div class="logo">

      </div>
      <a-menu v-model:selectedKeys="selectedKeys" theme="light" mode="inline">
        <a-menu-item v-for="(item, index) in data" :key="index">
          <span><router-link :to="item.path">{{ item.name }}</router-link></span>
        </a-menu-item>



      </a-menu>
    </a-layout-sider>
    <a-layout>
      <a-layout-header style="background: #fff; padding: 0">

        <el-row>
          <el-col :span="6">
            <menu-unfold-outlined v-if="collapsed" class="trigger" @click="() => (collapsed = !collapsed)" />
            <menu-fold-outlined v-else class="trigger" @click="() => (collapsed = !collapsed)" />
          </el-col>
          <el-col :span="18">
            <div>
              {{ name }}
              <el-button @click="headleOut">退出</el-button>
            </div>
          </el-col>
        </el-row>


      </a-layout-header>
      <a-layout-content :style="{ margin: '24px 16px', padding: '24px', background: '#fff', minHeight: '280px' }">
        <router-view></router-view>
      </a-layout-content>
    </a-layout>
  </a-layout>
</template>
<script lang="ts" setup>
import Breadcrumb from '@/components/Breadcrumb.vue';
import { ref } from 'vue';
import {
  UserOutlined,
  VideoCameraOutlined,
  UploadOutlined,
  MenuUnfoldOutlined,
  MenuFoldOutlined,
} from '@ant-design/icons-vue';
const selectedKeys = ref<string[]>(['1']);
const collapsed = ref<boolean>(false);
import router from '@/router';
// let data = JSON.parse(localStorage.getItem('rbac'))
// let token = JSON.parse(localStorage.getItem('token'))
// let name = JSON.parse(localStorage.getItem('name'))
const headleOut = () => {
  localStorage.removeItem('rbac')
  localStorage.removeItem('token')
  localStorage.removeItem('name')
  router.push('/login')
}

</script>
<style>
#components-layout-demo-custom-trigger .trigger {
  font-size: 18px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
}

#components-layout-demo-custom-trigger .trigger:hover {
  color: #1890ff;
}

#components-layout-demo-custom-trigger .logo {
  height: 32px;
  background: rgba(255, 255, 255, 0.3);
  margin: 16px;
}

.site-layout .site-layout-background {
  background: #fff;
}
</style>
